////////////////////////////////////////////////////////////////////////////////
//
//  FLYING KIWI BV
//  Copyright 2010 Flying Kiwi BV
//  All Rights Reserved.
//
//  NOTICE: Flying Kiwi permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////
package plantool.data {
	//--------------------------------------------------------------------------
	//  Imports
	//--------------------------------------------------------------------------
	//--------------------------------------------------------------------------
	//  [Metadata (Events, Style, Effects etc)]
	//--------------------------------------------------------------------------
	
	//--------------------------------------------------------------------------
	//  Class declaration
	//--------------------------------------------------------------------------
	public interface IDatabaseController {
		//--------------------------------------------------------------------------
		//Class properties
		//--------------------------------------------------------------------------
		function get connected():Boolean;
		//--------------------------------------------------------------------------
		//Class methods
		//--------------------------------------------------------------------------
		function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void;
		function close():void;
		function connect():void;
		function createDateFromTimestamp(timestamp:Number):Date;
		function createTable(table:Table, onCompleteHandler:Function):void;
		function getFieldName(type:uint):String;
		function formatDateField(field:String):String;
		function formatDate(date:Date):String;
		function query(q:String, onCompleteHandler:Function, onErrorHandler:Function, itemClass:Class = null, userdata:* = null):void;
		function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void;
		function transaction(querys:Array, onCompleteHandler:Function, onErrorHandler:Function, userdata:* = null):void;
	}
}